home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 283_01 / keys.h < prev    next >
Text File  |  1988-11-24  |  3KB  |  136 lines

  1. /* keys.h -- header file defines extended ascii characters
  2. **           4/20/88, d.c.oshel
  3. */
  4.  
  5. /*
  6. on return from keyshift_status(), flag bits (from AL) are set as follows:
  7.  7.......  1=Ins active (sticky)
  8.  .6......  1=Caps Lock (sticky)
  9.  ..5.....  1=Num Lock (sticky)
  10.  ...4....  1=Scroll Lock (sticky)
  11.  ....3...  1=Alt depressed (not sticky)
  12.  .....2..  1=Ctrl depressed (not sticky)
  13.  ......1.  1=Left Shift depressed (not sticky)
  14.  .......0  1=Right Shift depressed (not sticky)
  15. */
  16.  
  17.  
  18. /* these definitions require keyin() from the ciao library, or another
  19.    of my own functions; the style presented is consistent with the
  20.    emerging Borland function key standard, i.e., there seems to be a
  21.    de facto agreement among developers that IBM function keys should
  22.    return these values to C programs.  The hardware considerations are
  23.    not important (the Borland standard is an optimization of BIOS
  24.    behavior), so long as all future programs are consistent with these
  25.    values.
  26.    */
  27.  
  28. #define F1   0x3b00
  29. #define F2   0x3c00
  30. #define F3   0x3d00
  31. #define F4   0x3e00
  32. #define F5   0x3f00
  33. #define F6   0x4000
  34. #define F7   0x4100
  35. #define F8   0x4200
  36. #define F9   0x4300
  37. #define F10  0x4400
  38.  
  39. #define UP   0x4800
  40. #define DN   0x5000
  41. #define LF   0x4b00
  42. #define RT   0x4d00
  43. #define HOME 0x4700
  44. #define END  0x4f00
  45. #define PGUP 0x4900
  46. #define PGDN 0x5100
  47. #define INS  0x5200
  48. #define DEL  0x5300
  49.  
  50. #define Shift_F1   0x5400
  51. #define Shift_F2   0x5500
  52. #define Shift_F3   0x5600
  53. #define Shift_F4   0x5700
  54. #define Shift_F5   0x5800
  55. #define Shift_F6   0x5900
  56. #define Shift_F7   0x5a00
  57. #define Shift_F8   0x5b00
  58. #define Shift_F9   0x5c00
  59. #define Shift_F10  0x5d00
  60.  
  61. /* -- trivial case, these all map to digits
  62. #define Shift_UP   0x38        
  63. #define Shift_DN   0x32
  64. #define Shift_LF   0x34
  65. #define Shift_RT   0x36
  66. #define Shift_HOME 0x37
  67. #define Shift_END  0x31
  68. #define Shift_PGUP 0x39
  69. #define Shift_PGDN 0x33
  70. #define Shift_INS  0x30
  71. #define Shift_DEL  0x2e
  72. */
  73.  
  74. #define Alt_F1   0x6800
  75. #define Alt_F2   0x6900
  76. #define Alt_F3   0x6a00
  77. #define Alt_F4   0x6b00
  78. #define Alt_F5   0x6c00
  79. #define Alt_F6   0x6d00
  80. #define Alt_F7   0x6e00
  81. #define Alt_F8   0x6f00
  82. #define Alt_F9   0x7000
  83. #define Alt_F10  0x7100
  84.  
  85. /*  -- these are apparently not defined as ASCII on an IBM PC keyboard
  86. #define Alt_UP
  87. #define Alt_DN   
  88. #define Alt_LF   
  89. #define Alt_RT   
  90. #define Alt_HOME 
  91. #define Alt_END  
  92. #define Alt_PGUP 
  93. #define Alt_PGDN 
  94. #define Alt_INS  
  95. #define Alt_DEL
  96. */
  97.  
  98. #define Ctrl_F1   0x5e00
  99. #define Ctrl_F2   0x5f00
  100. #define Ctrl_F3   0x6000
  101. #define Ctrl_F4   0x6100
  102. #define Ctrl_F5   0x6200
  103. #define Ctrl_F6   0x6300
  104. #define Ctrl_F7   0x6400
  105. #define Ctrl_F8   0x6500
  106. #define Ctrl_F9   0x6600
  107. #define Ctrl_F10  0x6700
  108.  
  109. /* #define Ctrl_UP   -- does not exist */
  110. /* #define Ctrl_DN   -- does not exist */
  111. #define Ctrl_LF   0x7300
  112. #define Ctrl_RT   0x7400
  113. #define Ctrl_HOME 0x7700
  114. #define Ctrl_END  0x7500
  115. #define Ctrl_PGUP 0x8400
  116. #define Ctrl_PGDN 0x7600
  117. /* #define Ctrl_INS  -- does not exist */
  118. /* #define Ctrl_DEL  -- does not exist */
  119.  
  120.  
  121. /* miscellaneous */
  122.  
  123. #define CR  '\r'
  124. #define BS    '\b'
  125. #define ESC '\x1b'
  126. #define SPC ' '
  127. #define BLANK ' '
  128. #define TAB '\t'
  129. #define Shift_TAB 0x0f00
  130.  
  131. #define EOL '\0'
  132. #define APOSTROPHE '\''
  133. #define QUOTE '"'
  134.  
  135.  
  136.